package com.tiger.ebenv.sample1;

import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

public class Client {
    public static void main(String args[]) {
        try {
            InitialContext ctx = new InitialContext();
            Object obj = ctx.lookup("comp/env/ejb/EnvEntryTestBean");
            EnvEntryTestHome envEntryTestHome =
                (EnvEntryTestHome)PortableRemoteObject.narrow(
                obj, EnvEntryTestHome.class);
            EnvEntryTest envEntryTest = envEntryTestHome.create();
            System.out.println("StringEntry = " + envEntryTest.getString());
            System.out.println("IntegerEntry = " + envEntryTest.getInteger());
            System.out.println("BooleanEntry = " + envEntryTest.getBoolean());
            System.out.println("DoubleEntry = " + envEntryTest.getDouble());
            System.out.println("ByteEntry = " + envEntryTest.getByte());
            System.out.println("ShortEntry = " + envEntryTest.getShort());
            System.out.println("LongEntry = " + envEntryTest.getLong());
            System.out.println("FloatEntry = " + envEntryTest.getFloat());
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }
}
